Fix for NFS3 primary storage pool is failing to come out of maintenan… - #71
Fix for NFS3 primary storage pool is failing to come out of maintenan…#71sandeeplocharla wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the KVM storage pool deletion flow to properly handle the deleteStoragePool(uuid, details) code path (notably for libvirt-backed pools), which previously could fall back to the StorageAdaptor default implementation and skip actual deletion.
Changes:
- Added a
LibvirtStorageAdaptor#deleteStoragePool(String, Map<String,String>)override to route to the existing libvirt deletion logic. - Adjusted
KVMStoragePoolManager#deleteStoragePool(type, uuid, details)ordering around deletion vs HA monitor removal.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java | Adds an overload so deletion with details actually invokes libvirt pool removal logic. |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java | Changes when the adaptor delete call is executed relative to HA monitor removal for NFS pools. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6601541 to
be2f24e
Compare
|
|
||
| public boolean deleteStoragePool(StoragePoolType type, String uuid, Map<String, String> details) { | ||
| StorageAdaptor adaptor = getStorageAdaptor(type); | ||
| // For NetworkFilesystem, libvirt will take care of unmounting the nfs mount. If nfs mount has been removed before libvirt's pool |
There was a problem hiding this comment.
Would it be applicable to all vendors?
There was a problem hiding this comment.
Since both changes are in common/shared components, have we assessed the impact on other storage vendors? I just want to ensure that these updates don't introduce any unintended behaviour changes outside the ONTAP implementation.
There was a problem hiding this comment.
Yes, this impacts all the vendors using this. Currently, apart from our plugin, I've noticed only DefaultPrimary plugin using it. So, I've tested the same with that plugin and confirmed that the same issue exists even there. And these code changes have fixed it.
be2f24e to
705151d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java:420
- The 2-arg
deleteStoragePool(StoragePoolType, String)overload still unmounts NFS via_haMonitor.removeStoragePool(uuid)before calling into libvirt (adaptor.deleteStoragePool(uuid)). This ordering contradicts the rationale in the 3-arg overload (and can trigger libvirt pool destroy/undefine failures when the mount is removed first). Consider matching the safe ordering used in the 3-arg overload: delete the libvirt pool first, then remove the HA monitor entry (which unmounts).
StorageAdaptor adaptor = getStorageAdaptor(type);
if (type == StoragePoolType.NetworkFilesystem) {
_haMonitor.removeStoragePool(uuid);
}
boolean deleteStatus = adaptor.deleteStoragePool(uuid);
| } | ||
|
|
||
| @Override | ||
| public boolean deleteStoragePool(String uuid, Map<String, String> details) { |
There was a problem hiding this comment.
If you are not using details at all, why will a client code will use this method and not use public boolean deleteStoragePool(String uuid) ?
There was a problem hiding this comment.
public boolean deleteStoragePool(String uuid, Map<String, String> details) is being called within public boolean deleteStoragePool(StoragePoolType type, String uuid, Map<String, String> details) in KVMStoragePoolManager.java. Without this overload method here, the default implementation is being invoked, which just has status change.
Fix for NFS3 primary storage pool is failing to come out of maintenance mode
Description
This PR has the following:
deleteStoragePoolmethod leading to only just the change in the DB. This was leading to error in case ofCancel Maintenanceas the pool already exists with the host.Enable Maintenancecall comes, it was first removing the nfs mount, which was causing the libvirtd to error out duringDestroy Poolcall as the mount wasn't available.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Previously:So, clearly though the nfs mount was removed, the libvirtd still has the pool details with it.
Now: